# include "syscall.h"
# include "print.c"

void main(){
	int lock=-1;
	int cv = -1;
	int mv = -1;
	int value;
	
	lock = CreateLock("lock",4);
	cv = CreateCondition("cv",2);
	mv = CreateMVN("mv",2,1);

	Acquire(lock);
	
	value = GetMV(mv,0);
	printf("MV value is %d\n", &value);
	value++;
	SetMV(mv,0,value);
	
	Wait(cv,lock);

	value = GetMV(mv,0);
	printf("MV value is %d\n", &value);
	value--;
	SetMV(mv,0,value);
	
	Release(lock);
	printString("leave the wait\n");


	Exit(0);
}

